
<?php 


require ('application/classes/dao/PageView.php');

$p = new PageView($list['count'],10,$page,null);
$pageViewString = $p->echoPageAsDiv();

?>
<script type="text/javascript">
    
   
    function jump(){
        var jumppage = 0;
        if($("#page").val()==""){
            alert("请输入你要跳转页数")
            return;
        }else{


            window.location.href='<?php echo Url::base(); ?>/index.php/user/userMessage?page='+$("#page").val();
        }

    }
</script>

<div class="personal-r f-r">
        	<div class="personal-right">
                <div class="personal-r-tit">
                    <h3>消息中心</h3>
                </div>
                <div class="theme">
                    <p class="th-p1 f-l">
                        <input type="checkbox" value="" name="all"></input>
                        <span>选择</span>
                    </p>
                    <p class="th-p2 f-l">
                        <img src="<?php echo Url::base(); ?>images/th-wenjian-tu.gif" />
                    </p>
                    <p class="th-p3 f-l">主题</p>
                    <p class="th-p4 f-l">时间</p>
                </div>
                <div class="per-info">
                    <ul>


                        <?php
                            foreach ($list['result'] as $key=>$value){ 
                                if($value['status'] =='未读'){
                                    ?>
 <li>
                            <input type="checkbox" value="<?php echo $value['id'];?>" name="id"></input>
                            <p class="p-tu f-l"><img src="<?php echo Url::base(); ?>images/th-wenjian-tu.gif" /></p>
                            <a href="<?php echo Url::base(); ?>index.php/user/detailMessage?id=<?php echo $value['id'];?>" class="p-font f-l"><?php echo $value['title'];?></a>
                            <p class="p-time f-l"><?php echo date('Y年m月d日',strtotime($value['createDate']));?></p>
                            <div style="clear:both;"></div>
                        </li>
                             <?php
                                }else{
                                    ?>
                                
<li>
                            <input type="checkbox" value="<?php echo $value['id'];?>"  name="id"></input>
                            <p class="p-tu f-l"><img src="<?php echo Url::base(); ?>images/th-wenjian-tu2.gif" /></p>
                            <a href="<?php echo Url::base(); ?>index.php/user/detailMessage?id=<?php echo $value['id'];?>" class="p-font p-font1 f-l"><?php echo $value['title'];?></a>
                            <p class="p-time f-l"><?php echo date('Y年m月d日',strtotime($value['createDate']));?></p>
                            <div style="clear:both;"></div>
                        </li>
                       


                        <?php
                            }
                        }
                        ?>

                       
                        
                    </ul>
                </div>
                
                    </ul>
                </div>

                <script type="text/javascript">
                    
                    function del(){
                        var id = ""
                        $("input[name='id']").each(function($key,$value){
                            if($value.checked){
                                id=$($value).val()+","
                            }
                        })
                        if(id==""){
                            alert("请选择删除对象")
                        }else{
                             $.ajax({

                                type: 'post',

                                url:  '<?php echo Url::base(); ?>index.php/user/deteleMessage',

                                data: {id:id} ,

                                success: function(data){
                                    alert(data['data'])
                                    window.location.reload();
                                },

                                dataType: 'json'

                            });
                        }
                    }
                </script>
                <button class="per-del" onclick="del()">删除选项</button>
            </div>
            
            <!--分页-->
            <div class="paging">
            	<div class="pag-left f-l">

                <?php echo $pageViewString;

                ?>
                	
                
        
                <div style="clear:both;"></div>
             
            </div>
        </div>
        <div style="clear:both;"></div>
    </div>

  
